package com.translate.web.constant;

import java.util.HashMap;
import java.util.Map;

public enum OrderErrorMsg {

	INSUFFICIENT_BALANCE(-1, "余额不足"),

	PLOTTING_MANUSCRIPTS(3001, "作图稿件不能为空"),

	BASIC_SERVICES_MANUSCRIPTS(3002, "基础服务稿件不能为空"),

	NO_BASIC_SERVICE_ORDERS(3003, "基础服务没有订单信息"),

	NO_PLOTTING_SERVICE_ORDERS(3004, "作图服务没有订单信息"), BASIC_SERVICES_WORD_SIZE(3005, "基础服务字数不能为 0"),

	ERROR_MSG(3005, "异常"),
	
	NOT_FOUND_ORDER_BY_ID(3006, "找不到此订单"),
	
	PAY_ERROR(3007, "只有作图服务才能在订单模块中支付"),

	SUCCESS(200, "成功")

	;

	private static Map<Integer, OrderErrorMsg> map = new HashMap<>();

	static {
		for (OrderErrorMsg value : OrderErrorMsg.values()) {
			map.put(value.getCode(), value);
		}
	}

	private int code;

	private String msg;

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	OrderErrorMsg(int code, String msg) {
		this.code = code;

		this.msg = msg;
	}
	
	public static OrderErrorMsg getErrorMsg(int code){
        return map.get(code);
    }

}
